package refparam;

import java.util.Random;

public class Monster {
	public String type;
	public int blood;
	
	public void beatPlayer(Player player) {
		System.out.println(type + "怪物发起进攻");
		Random rand = new Random();
		// 攻击
		int attech = rand.nextInt(10);
		// 怪物的血量减少
		player.blood -= attech;
		System.out.println("玩家的血量 -" + 
		   attech + ",现有血量:" + player.blood);
	}
}
